<div class="content">
	<div class="main">
		<?php 
			if( !$this->have() ){ 
				echo "\t\t<div class='notfound'>" . PHP_EOL;
				echo "\t\t\t<p><img src=''/></p>" . PHP_EOL;
				echo "\t\t\t<h3>抱歉，没有找到相关内容！</h3>" . PHP_EOL;
				echo "\t\t</div>" . PHP_EOL;
			}else{
				echo "\t\t<ul class='main_list'>" . PHP_EOL;
				while( $this->next() ){

					$attach = $this->db->fetchRow($this->db->select()->from('table.contents')->where('type = \'attachment\' AND parent = ?', $this->cid));
					if(empty($attach)){
						$attach_url = Typecho_Common::url('images/nopic.gif', $this->options->themeUrl);
					}else{
						$attach_text = unserialize($attach['text']);
						$attach_path = $attach_text['path'];
						$attach_url = Typecho_Common::url($attach_path, $this->options->index);						
					}

					echo "\t\t\t<li><div><a href='{$this->permalink}' title='{$this->title}'><img src='{$attach_url}' /></a></div>" . PHP_EOL;
					echo "\t\t\t\t<p><a href='{$this->permalink}' title='{$this->title}'>{$this->title}</a></p></li>" . PHP_EOL;
				}
				echo "\t\t</ul><div class='clear'></div>" . PHP_EOL;
				echo "\t\t<div class='pagenav'>" . PHP_EOL;
				$this->pageNav('上一页','下一页',5,'...');
				echo "\t\t<div class='clear'></div></div>" . PHP_EOL;
			}
		?>
	</div>
	
	<div class="sidebar">
		<div class="sidebox">
			<h3 class="side_title"><b>产品标签</b></h3>
			<div class="side_box_list side_tags">
			<?php 
				/** 循环输出标签  @MrAsong
				 * widget('Widget_Metas_Tag_Cloud', 'limit=n') 可以限制输出n个 */
				$this->widget('Widget_Metas_Tag_Cloud')->to($tags);
				while($tags->next()): 
					$class_on = $this->is('tag', $tags->slug) ? 'class="on"' : '' ;
					echo "\t\t\t<a href='{$tags->permalink}' title='{$tags->name}' {$class_on}>{$tags->name}</a>" . PHP_EOL;
				endwhile;
			?>
			</div>
		</div>

		<div class="sidebox">
			<h3 class="side_title"><b><a href="<?php $this->options->index('category/'.___NEWS___);?>" title="根雕新闻">根雕新闻</a></b></h3>
			<ul class="side_box_list">
			<?php 
				$this->widget('Widget_Archive@Cate_News', 'type=category&pageSize='.___SIZE___, 'slug='.___NEWS___ )
					->parse("\t\t\t<li><a href='{permalink}' title='{title}'>{title}</a></li>");
			?>
			</ul>
		</div>
		
		<div class="sidebox">
			<h3 class="side_title"><b><a href="<?php $this->options->index('category/'.___INFO___);?>" title="根雕资讯">根雕资讯</a></b></h3>
			<ul class="side_box_list">
			<?php 
				$this->widget('Widget_Archive@Cate_Info', 'type=category&pageSize='.___SIZE___, 'slug='.___INFO___ )
					->parse("\t\t\t<li><a href='{permalink}' title='{title}'>{title}</a></li>");
			?>
			</ul>
		</div>
	</div>
	
	<div class="c_btn">关闭</div>
</div>
<script type="text/javascript">
var h_l = 'main';
var h_r = 'sidebar';
</script>